// 引入axios
import axios from 'axios'
// 甚至基础路径
axios.defaults.baseURL = 'http://localhost:8888/api'

// 创建获得新闻列表内容的请求
export const getNewsList = () => axios.get('/getnewslist').then(res => res.data)
// 获得新闻详情
export const getNewsDetail = id => axios.get(`/getnew/${id}`).then(res => res.data)
